#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <string>
#include <iostream>

using namespace std;

#include "topdbs.hpp"

void dbsfile_test(const string& dbsGroup )
{
    string dbsfile("/home/aips/etc/topdbs.ini");
    DBSConnectionParams dbsconfig;
    if( readDbsfile(dbsfile,dbsconfig,dbsGroup) != 0)
    {
        printf("NOT FOUND [%s]\n",dbsGroup.c_str());
    }
    else 
    {
        printf("read dbsfile [%s] succed.\n",dbsGroup.c_str());
        printf("dbsType=[%s],dbsConnStr=%s\n",topdbs_client_desc(dbsconfig.dbsType),dbsconfig.dbsConnStr.c_str());
    }  
    printf("\n\n");  
}

int main()
{
    dbsfile_test("aipsdb_mysql");
    dbsfile_test("aipsdb_informix");
    dbsfile_test("aipsdb_oracle");     
    return 0;
}